From fb6a7b039d71282dd271f60e294baaa9d68618ad Mon Sep 17 00:00:00 2001 From: YAMAMOTO Mitsuharu Date: Fri, 11 Jul 2008 08:53:33 +0000 Subject: [PATCH] [USE_MAC_TSM] (mac_handle_text_input_event): Check if FACE_FROM_ID returns NULL. --- src/mactoolbox.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/mactoolbox.c b/src/mactoolbox.c index 45a86135422..f470c517554 100644 --- a/src/mactoolbox.c +++ b/src/mactoolbox.c @@ -575,7 +575,7 @@ mac_handle_text_input_event (next_handler, event, data) int hpos, vpos, x, y; struct glyph_row *row; struct glyph *glyph; - XFontStruct *font; + struct face *face; f = mac_focus_frame (&one_mac_display_info); w = XWINDOW (f->selected_window); @@ -600,9 +600,10 @@ mac_handle_text_input_event (next_handler, event, data) + row->visible_height + f->top_pos + FRAME_OUTER_TO_INNER_DIFF_Y (f)); - font = FACE_FROM_ID (f, glyph->face_id)->font; - if (font) + face = FACE_FROM_ID (f, glyph->face_id); + if (face && face->font) { + XFontStruct *font = face->font; Fixed point_size = Long2Fix (font->mac_fontsize); short height = row->visible_height; short ascent = row->ascent; -- 2.30.2